package org.pezke.akunature.model.fb;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

import org.hibernate.search.annotations.Indexed;
import org.pezke.akunature.model.BaseObject;


/**
 * @author igarcia
 */
@Entity
@Table(name = "akn_fb_group_")
@Indexed
@XmlRootElement
public class FBachGroup extends BaseObject implements Serializable {

	/** serial version UID */
	private static final long serialVersionUID = 1L;


	/***************************************************************************
	 * Atributos
	 **************************************************************************/

	/** Identificador */
	private Long id = null;

	/** Nombre del grupo */
	private String name = null;

	

	/***************************************************************************
	 * Constructores
	 **************************************************************************/

	/**
	 *
	 * <b>Constructor:</b> FBachGroup
	 */
	public FBachGroup() {

	}

	/***************************************************************************
	 * Getters y setters
	 **************************************************************************/

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id_")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "name_")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	public boolean equals(Object obj) {
		FBachGroup other = (FBachGroup)obj;
		return other.getId().longValue()==other.getId().longValue();
	}
	
	/*
	 * (non-Javadoc)
	 * @see org.pezke.akunature.model.BaseObject#toString()
	 */
	public String toString() {
		StringBuffer result = new StringBuffer("FBachGroup [id=");
		result.append(this.id);
		result.append("]");
		return result.toString();
	}

	/*
	 * (non-Javadoc)
	 * @see org.pezke.akunature.model.BaseObject#hashCode()
	 */
	public int hashCode() {
		long f = this.id.longValue();
		return (int) (f ^ (f >>> 32));
	}

}
